package com.bjfu.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import com.bjfu.demo.entity.pojo.RpCondition;
import com.bjfu.demo.service.DataService;

/**
 * @create 2021-02-22 10:53
 */
@RestController
public class DataController {

  @Autowired private DataService dataService;

  //http://localhost:8080/dataGetOne/119
  @GetMapping("/dataGetOne/{id}")
  public Object get(@PathVariable Integer id) {
    Object o = dataService.get(id);
    return o;
  }

  @PostMapping("/getData")
  public Object getData(@RequestBody RpCondition rpCondition) {
    Object o = dataService.getRpData(rpCondition);
    return o;
  }
}
